package com.juli.v2xdemo.listener;


import android.view.View;

import com.juli.v2xdemo.entity.Car;


public class AddHeroListener extends AddEntityListener<Car>{

	public AddHeroListener(Car t) {
		super(t);
	}

	@Override
	protected void onLayoutFinish() {
		Car carData = t;
		
		//将heao设置到底部中心
//		int parentWidth = ((ViewGroup) carData.getParent()).getWidth();
//		int parentHeitht = ((ViewGroup) carData.getParent()).getHeight();
//		float translationX = parentWidth/2 - carData.getWidth()/2;
//        float setx = carData.getSetx();
//        float sety = carData.getSety();
//        carData.setTranslationX(translationX);
//		carData.setTranslationY(parentHeitht- carData.getHeight());
//		carData.setVisibility(View.VISIBLE);



        float x = carData.getX();
        float y = carData.getY();
        carData.setTranslationX( x);
		carData.setTranslationY(y- carData.getHeight());

		carData.setVisibility(View.VISIBLE);
	}

}
